﻿<UserControl x:Class="Visual.Views.AddPerson"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:v="clr-namespace:Visual.ViewModels"
             xmlns:utils="clr-namespace:CPDPWEM.Utils;assembly=Utils"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <UserControl.DataContext>
        <v:AddPersonViewModel />
    </UserControl.DataContext>
    <StackPanel>
        <TextBox Text="{Binding FullPersonName, UpdateSourceTrigger=PropertyChanged}"
                 utils:FocusExtension.IsFocused="{Binding IsTextBoxFocused, Mode=TwoWay}"/>
        <Button Content="Create Person" Command="{Binding AddPersonCommand}" />
        <GroupBox Header="All Teh Peoplez" Height="100">
            <ItemsControl ItemsSource="{Binding People}">
                <ItemsControl.ItemsPanel>
                    <ItemsPanelTemplate>
                        <WrapPanel Orientation="Vertical"/>
                    </ItemsPanelTemplate>
                </ItemsControl.ItemsPanel>
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <TextBlock Text="{Binding FullName}" />
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>
        </GroupBox>
    </StackPanel>
</UserControl>
